/*----------------------------------------------------------------------------






----------------------------------------------------------------------------*/

#ifndef	_PROJECT_EXCEPT_HPP_
#define	_PROJECT_EXCEPT_HPP_

#include	"../base/exception.hpp"



/**
	Exception thrown when an error occurs during parsing.


	@version	0.1
	@author		<a href="mailto:cant.project@gmail.com">Mikey</a>
*/
class ParserException	: public Exception
{
	private:
		/**
			Line number.
			
		*/
		int					m_iLineNumber;
		
		
	public:
		/**
			Constructor.

			@param		a_strMessage			error message.
			@param		a_iLine					line number causing error.
		*/
		ParserException(const std::string& a_strMessage, int a_iLineNumber = -1 );
		

		/**
			Gives the name of this exception's type.
			
			@return		type name.
		*/
		virtual std::string	getType(void ) const;
		
		
		/**
			Gives the number of the line causing the error.
			
			@return		line number.
		*/
		int	getLineNumber(void ) const;
};



//--------------------------------------------------------------------------//



/**
	Exception thrown when an error occurs during execution of a target or
	its contained tags.


	@version	0.1
	@author		<a href="mailto:cant.project@gmail.com">Mikey</a>
*/
class TagException	: public ParserException
{
	public:
		/**
			Constructor.

			@param		a_strMessage			error message.
			@param		a_iLine					line number causing error.
		*/
		TagException(const std::string& a_strMessage, int a_iLineNumber = -1 );
		

		/**
			Gives the name of this exception's type.
			
			@return		type name.
		*/
		virtual std::string	getType(void ) const;
};



//--------------------------------------------------------------------------//



/**
	Exception thrown when an error occurs whilst evaluating a
	<code>ProjectProperty</code>.


	@version	0.1
	@author		<a href="mailto:cant.project@gmail.com">Mikey</a>
*/
class PropertyException	: public ParserException
{
	public:
		/**
			Constructor.

			@param		a_strMessage			error message.
			@param		a_iLine					line number causing error.
		*/
		PropertyException(const std::string& a_strMessage, int a_iLineNumber = -1 );
		

		/**
			Gives the name of this exception's type.
			
			@return		type name.
		*/
		virtual std::string	getType(void ) const;
};



//--------------------------------------------------------------------------//



/**
	Exception thrown when an error occurs within a <code>Project</code>.


	@version	0.1
	@author		<a href="mailto:cant.project@gmail.com">Mikey</a>
*/
class ProjectException	: public ParserException
{
	public:
		/**
			Constructor.

			@param		a_strMessage			error message.
		*/
		ProjectException(const std::string& a_strMessage );
		

		/**
			Gives the name of this exception's type.
			
			@return		type name.
		*/
		virtual std::string	getType(void ) const;
};

#endif
